
var initRolesInfoBean;
var getRolesInfoBeanFromOpenPage = function(){
	var rolesinfoBean = {};
	
	rolesinfoBean.id = jQuery('#idEditor').val();
	
	rolesinfoBean.name = jQuery('#nameEditor').val();
	if(!rolesinfoBean.name){
		$.ligerDialog.error("请输入角色名称!");
		return null;
	}
	
	return rolesinfoBean;
};

var initRolesInfoPage = function(){
	
	
};

var bindRolesInfoUpdateButtom = function(){
	jQuery('#updateEdit').unbind('click').click(function(){
		var rolesinfoBean = getRolesInfoBeanFromOpenPage();
		if(null != rolesinfoBean){
			doSaveRolesInfos([rolesinfoBean]);
		}
	});
};
var bindRolesInfoResetButtom = function(){
	jQuery('#resetEdit').unbind('click').click(function(){
		if(!initRolesInfoBean){
			jQuery("#nameEditor").val('');
		}else{
			if(!initRolesInfoBean.name){
				jQuery("#nameEditor").val('');
			}else{
				jQuery("#nameEditor").val(initRolesInfoBean.name);
			}
		}
	});
};



jQuery(function(){
	initRolesInfoPage();
	bindRolesInfoUpdateButtom();
	bindRolesInfoResetButtom();
});